package Work20241116;

/**
 * @author zdl
 * @date 2024/11/16
 */
public class Demo15 {
    public static void main(String[] args) {
        //从1加到100.（使用while实现）
        int n =1;
        int sum = 0;
        while (n<=100){
            sum+=n;
            n++;
        }
        System.out.println(sum);
    }
}
